package com.zhdl.modules.system.service.impl;

import com.project.common.service.impl.BaseServiceImpl;
import com.zhdl.modules.system.entity.CustomerUser;
import com.zhdl.modules.system.repository.CustomerUsersRepository;
import com.zhdl.modules.system.service.CustomerUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@Service
public class CustomerUserServiceImpl extends BaseServiceImpl<String, CustomerUser, CustomerUsersRepository> implements CustomerUserService {

    @Resource
    private CustomerUsersRepository customerUsersRepository;

    /**
     * 查询所有用户List
     *
     * @return 用户List
     */
    @Override
    public List<CustomerUser> findAll() {
        return customerUsersRepository.findAll();
    }

    /**
     * 通过用户名查询相关信息
     *
     * @param username 用户名
     * @return 用户信息
     */
    @Override
    public CustomerUser findCustomerUserByUserName(String username) {
        return customerUsersRepository.findByUsername(username);
    }


}
